package com.zzh.jetpackdemo.manager.worker

import android.content.Context
import android.util.Log
import androidx.work.Data
import androidx.work.Worker
import androidx.work.WorkerParameters

/**
 * @author zhangzhihao
 * @email zhangzhihao@gongjiangren.net
 * @date 2021-01-05
 * @desc
 */

private val TAG = MyWorker::class.java.name


open class MyWorker(context: Context, workerParams: WorkerParameters) : Worker(
    context,
    workerParams
) {


    override fun doWork(): Result {
        Log.i(TAG, "doWork: ${inputData.getString("zzh")}")
        var data = Data.Builder()
            .putString("value", "shu ju lai le")
            .build()
        return Result.success(data)
    }
}